Caption = "Enter a postcode in the POSTCODE field (try B1 1AA) and press enter. AFD's POSTCODE will return the Street, Town, County and dialing Code into the appropriate fields"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 1170
Left = 4740
TabIndex = 14
Top = 1065
Width = 2355
WordWrap = -1 'True
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Telephone"
Height = 285
Index = 6
Left = 360
TabIndex = 13
Top = 2760
Width = 1365
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "County"
Height = 285
Index = 5
Left = 360
TabIndex = 12
Top = 2400
Width = 1365
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Town"
Height = 285
Index = 4
Left = 360
TabIndex = 11
Top = 2040
Width = 1365
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Street"
Height = 285
Index = 3
Left = 360
TabIndex = 10
Top = 1680
Width = 1365
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "FirstLine"
Height = 285
Index = 2
Left = 360
TabIndex = 9
Top = 1320
Width = 1365
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Name"
Height = 285
Index = 1
Left = 360
TabIndex = 8
Top = 930
Width = 1365
End
Begin Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Post Code"
Height = 285
Index = 0
Left = 360
TabIndex = 7
Top = 585
Width = 1365
End
Begin Label Label3
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Height = 1350
Left = 4665
TabIndex = 15
Top = 975
Width = 2475
End
Sub Command1_Click ()
Unload Me
End Sub
Sub DoDDE ()
On Error GoTo DDE_ERROR
' Initialise a link to Postcode
' and send it some data
FBox(0).LinkMode = 0
FBox(0).LinkTopic = "POSTCODE|PCFILL"
FBox(0).LinkItem = "POSTCODE"
FBox(0).LinkMode = 2
FBox(0).LinkPoke
' Request the data for the other fields
FBox(3).LinkTopic = "POSTCODE|PCFILL"
FBox(3).LinkItem = "Street"
FBox(3).LinkMode = 2
FBox(3).LinkRequest
FBox(4).LinkTopic = "POSTCODE|PCFILL"
FBox(4).LinkItem = "Town"
FBox(4).LinkMode = 2
FBox(4).LinkRequest
FBox(5).LinkTopic = "POSTCODE|PCFILL"
FBox(5).LinkItem = "County"
FBox(5).LinkMode = 2
FBox(5).LinkRequest
FBox(6).LinkTopic = "POSTCODE|PCFILL"
FBox(6).LinkItem = "STD"
FBox(6).LinkMode = 2
FBox(6).LinkRequest
FBox(1).SetFocus
Exit Sub
DDE_ERROR:
MsgBox "You must have postcode running before attempting to link to it. Please run POSTCODE and re try this example. "
Exit Sub
End Sub
Sub FBox_Change (Index As Integer)
If Index = 0 Then
FBox(Index).Text = UCase(FBox(Index).Text)
FBox(Index).SelStart = Len(FBox(Index).Text)
End If
End Sub
Sub FBox_KeyPress (Index As Integer, KeyAscii As Integer)